﻿<UserControl 
  x:Class="ContentControl3D_Demo.Samples.PropertyExplorerSample"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:thriple="http://thriple.codeplex.com/"
  >
  <UserControl.Resources>
    <DataTemplate x:Key="FrontAndBackTemplate">
      <Border 
        Background="#22000000" 
        BorderBrush="#88000000"
        BorderThickness="1"
        >
        <Image 
          Source="{Binding}" 
          Stretch="UniformToFill" 
          HorizontalAlignment="Center" 
          VerticalAlignment="Center" 
          Width="400" Height="300"
          />
      </Border>
    </DataTemplate>
  </UserControl.Resources>
  
  <DockPanel>
    <DockPanel.Background>
      <ImageBrush ImageSource="Images/Water.jpg" />
    </DockPanel.Background>

    <Grid DockPanel.Dock="Bottom" Background="#88000000">
      <GroupBox 
        FontWeight="Bold" 
        Foreground="WhiteSmoke" 
        Header="ContentControl3D Properties" 
        Margin="4"
        Padding="4,8"
        >
        <StackPanel HorizontalAlignment="Center" TextBlock.FontWeight="Normal" TextBlock.Foreground="Black">

          <StackPanel Orientation="Horizontal">
            <!-- ROTATION DIRECTION -->
            <TextBlock Text="Rotation Direction: " Foreground="WhiteSmoke" VerticalAlignment="Center" />
            <ComboBox 
              x:Name="rotationDirectionSelector" 
              Margin="4,0,8,0"
              SelectedItem="{Binding ElementName=cntCtrl3D, Path=RotationDirection}" 
              Width="150" 
              />

            <!-- EASING MODE -->
            <TextBlock Text="Easing Mode: " Foreground="WhiteSmoke" VerticalAlignment="Center" />
            <ComboBox 
              x:Name="easingModeSelector" 
              Margin="4,0,8,0"
              SelectedItem="{Binding ElementName=cntCtrl3D, Path=EasingMode}" 
              Width="120" 
              />

            <!-- CAMERA ZOOM DESTINATION -->
            <TextBlock Text="Camera Zoom Destination: " Foreground="WhiteSmoke" VerticalAlignment="Center" />
            <TextBox 
              FontFamily="Courier New" 
              FontSize="14"
              Margin="4,0,8,0"
              Text="{Binding ElementName=cntCtrl3D, Path=CameraZoomDestination, UpdateSourceTrigger=PropertyChanged, ValidatesOnExceptions=True}" 
              ToolTip="Enter a Point3D value here, of the form X,Y,Z"
              Width="120"  
              >
              <TextBox.Style>
                <Style TargetType="{x:Type TextBox}">
                  <Style.Triggers>
                    <Trigger Property="Validation.HasError" Value="True">
                      <Setter Property="Foreground" Value="Red" />
                    </Trigger>
                  </Style.Triggers>
                </Style>
              </TextBox.Style>
            </TextBox>
          </StackPanel>

          <StackPanel Orientation="Horizontal" Margin="0,12,0,0">
            <!-- ANIMATION LENGTH -->
            <DockPanel>
              <TextBlock DockPanel.Dock="Left" Text="Animation Length: " Foreground="WhiteSmoke" VerticalAlignment="Center" />
              <TextBlock 
                DockPanel.Dock="Right" 
                Foreground="WhiteSmoke"
                Text="{Binding ElementName=cntCtrl3D, Path=AnimationLength}" 
                VerticalAlignment="Center" 
                Width="60"
                />
              <Slider 
                Minimum="10" Maximum="2000"
                Value="{Binding ElementName=cntCtrl3D, Path=AnimationLength}" 
                Width="490"
                />
            </DockPanel>

            <Button 
              Command="thriple:ContentControl3D.RotateCommand" 
              CommandTarget="{Binding ElementName=cntCtrl3D}"
              Content="Flip" 
              IsDefault="True" 
              Margin="8,0" 
              Width="80" 
              />
          </StackPanel>
        </StackPanel>
      </GroupBox>
    </Grid>
   

    <thriple:ContentControl3D 
      x:Name="cntCtrl3D"
      BackContent="Images/Fish2.jpg"
      BackContentTemplate="{StaticResource FrontAndBackTemplate}"
      Background="#88FFFFFF"
      BorderBrush="DarkGray"
      BorderThickness="4"
      Content="Images/Fish1.jpg"        
      ContentTemplate="{StaticResource FrontAndBackTemplate}"
      MaxWidth="600" MaxHeight="600"
      />

  </DockPanel>
</UserControl>